﻿<!DOCTYPE html>
<html lang="cn" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <title>首页</title>
    <script type="text/javascript" th:src="@{/static/vue.js}"></script>
    <script>
        var vue = new Vue({
            el:'#deleteUser',
            methods:{
                deleteUserMethode:function (){
                    alert(1);
                    var  deleteForm= document.getElementById('deleteUser');
                    deleteForm.action =event.target.href;
                    //提交表单
                    deleteForm.onsubmit();
                    //取消超链接的默认行为
                    event.preventDefault();
                }
            }
        })
    </script>
</head>
<body>
<a th:href="@{/rest/user}" >获取单个用户信息</a><br/>
<a th:href="@{/rest/users}" >获取用户信息</a><br/>
 <a th:href="@{'/rest/update/1'}"></a>
<a   @click="deleteUserMethode" th:href="@{'/rest/delete/1'}">删除</a>
<form id="deleteUser" method="post" >
    <input type="hidden" name="_method" value="delete">
</form>
</body>
</html>